#include "soduku.h"
#include "block.h"
#include <string>
#include <cassert>
void Soduku::_allocate_mem()
{
  assert(_num_rows>0 && _num_cols>0);
  assert(_block);
  for (int i = 0; i < _num_rows; ++i)
    _block[i] = new Block[_num_cols];
}

Soduku::Soduku(int rows, int cols)
  : _num_rows(rows), _num_cols(cols), _block(new (Block*)[_num_rows])
{
  _allocate_mem();
}

Soduku::Soduku(int rows, int cols, const string &infile_name)
  : _num_rows(rows), _num_cols(cols), _block(new (Block*)[_num_rows])
{
  _allocate_mem();
}

Soduku::~Soduku()
{
  assert(_num_rows>0);
  for (int i = 0; i < _num_rows; ++i)
    delete []_block[i]
  delete []_block;
  _block = 0;
}
